//
// Created by chizuru on 2025/9/17.
//

#pragma once
#include "IDeviceIO.h"
#include <memory>
#include <any>

class DeviceDecorator : public IDeviceIO {
protected:
    std::shared_ptr<IDeviceIO> inner;
public:
    explicit DeviceDecorator(std::shared_ptr<IDeviceIO> i) : inner(std::move(i)) {}

    int write(const char* data, size_t size) override {
        return inner->write(data, size);
    }

    int read(char* buf, size_t maxSize) override {
        return inner->read(buf, maxSize);
    }

    int flushReadAndWrite() override {
        return inner->flushReadAndWrite();
    }
};
